package com.typhoon.spring_jdbctemplate.dao.ha;

import java.util.ArrayList;

public class Test1 {

	public static void main(String[] args) {
		BalanceNodeBean nodeBean = null;
		ArrayList<BalanceNodeBean> serverList = new ArrayList<>(3);
		for(int i = 0;i < 3;i ++) {
			nodeBean = new BalanceNodeBean();
			nodeBean.setDownFlag(0);//初始化不是挂掉
			serverList.add(nodeBean);
		}
		
		int result = MyLoadBalance.getForwardServerIndex(serverList);
		System.out.println(result);
		result = MyLoadBalance.getForwardServerIndex(serverList);
		System.out.println(result);
		result = MyLoadBalance.getForwardServerIndex(serverList);
		System.out.println(result);
		result = MyLoadBalance.getForwardServerIndex(serverList);
		System.out.println(result);
	}

}
